<template>
  <div class="layout">
    <div class="flex-sc">
      <div class="mr12 h38 h38"><img class="hh100" src="@/assets/images/c3.png" /></div>
      <div class="line1 f18">{{v.name}}</div>
    </div>
    <div class="flex-sc f14 mt12">
      <div class="w50" style="color: #CECCDC;">位置</div>
      <div class="line2 flex1">{{v.instlPos}}</div>
    </div>
    <div class="flex-sc f14 mt12">
      <div class="w50" style="color: #CECCDC;">通信</div>
      <div class="w50 fw" :class="v.offline==0?'i21':'i6'">{{v.offline==0? '在线' : v.offline==1? '离线' : '故障'}}</div>
      <div class="w50" style="color: #CECCDC;">诊断</div>
      <div class="w50 fw" :class="v.isAlarm==1?'i8':'i21'">{{v.isAlarm==1? '异常' : '正常'}}</div>
    </div>
    <div class="absolute f18 flex-ec ww50" style="right: -5px; bottom: -5px">
      <div class="flex-col-cc p5 mlr3 i21">
        <span class="f12 mb5">温度</span>
        <span class="fw">{{v['2054']?Math.round(v['2054']*10)/10+'℃':'/'}}</span>
      </div>
      <div class="flex-col-cc p5 mlr3 i21">
        <span class="f12 mb5">湿度</span>
        <span class="fw">{{v['2055']?Math.round(v['2055']*10)/10+'%':'/'}}</span>
      </div>
      <div class="flex-col-cc p5 mlr3 i6" v-if="v.measure && v.measure.find(a=>a.code == 'temperature_diff')">
        <span class="f12 mb5">{{v.measuring_phase == 'A'? 'AB相' : v.measuring_phase == 'B'? 'BC相' : v.measuring_phase == 'C'? 'AC相' : '/'}}温差</span>
        <span>{{v.temperature_diff?Math.round(v.temperature_diff*10)/10+'℃':'/'}}</span>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
  const props = defineProps({
    v: {
      type: [Object, Array],
      default: ()=>{return {}}
    },
  })
</script>

<style lang="scss">

</style>